class Person {
  // 成员属性: 声明成员属性(js写class时不需要把name age 抽出来先声明)
  name: string;
  age: number;

  constructor(name: string, age: number) {
    this.name = name;
    this.age = age;
  }

  eating() {
    console.log(this.name + " eating");
  }

  running() {
    console.log(this.name + " running");
  }
}

// 实例对象: instance
const p1 = new Person("why", 18);
const p2 = new Person("kobe", 30);

console.log(p1.name, p2.age);

export {};
